using NServiceBus;
using NServiceBus.Host;

namespace LifecycleAwareness
{
    public class DemoEndpoint:IMessageEndpoint
    {
        public IBus Bus { get; set; }
        public void OnStart()
        {
            Bus.SendLocal(new SendEmailRequest
                              {
                                  ToAdress = "test@test.com", 
                                  Body = "Hello", 
                                  Subject = "World"
                              });
        }

        public void OnStop()
        {
            
        }
    }
}